<template>
  <div>
    <button @click="toggle">点击奇幻盒子显示或者隐藏</button>
    <div class="box" v-if="show">我是等待切换的盒子</div>
    <div class="box" v-if="age > 60">广场舞</div>
    <div class="box" v-else-if="age > 30">搓麻将</div>
    <div class="box" v-else-if="age > 20">蹦迪</div>
    <div class="box" v-else>写作业</div>
  </div>
</template>
<script>
export default {
  name: 'if-Show',
  data() {
    return {
      show: false,
      age: 18,
    }
  },
  methods: {
    toggle() {
      this.show = !this.show
    },
  },
}
</script>
